package com.kkb.springmvc.mapping;

import com.kkb.springmvc.handler.QueryUserHandler;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

public class BeanNameUrlHandlerMapping implements HandlerMapping {

    private Map<String,Object> urlHandlers = new HashMap<>();

    public BeanNameUrlHandlerMapping() {
        this.urlHandlers.put("/queryUser",new QueryUserHandler());
    }

    @Override
    public Object getHandler(HttpServletRequest request) throws Exception {
        return this.urlHandlers.get(request.getRequestURI());
    }
}
